<!DOCTYPE HTML>
<html lang="zh-Hans" class="light" dir="ltr">
    <head>
        <!-- Book generated using mdBook -->
        <meta charset="UTF-8">
        <title>TypeScript 2.1 - TypeScript 使用指南手册</title>


        <!-- Custom HTML head -->
        
        <meta name="description" content="TypeScript Handbook 中文翻译。">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="theme-color" content="#ffffff">

        <link rel="icon" href="../../favicon.svg">
        <link rel="shortcut icon" href="../../favicon.png">
        <link rel="stylesheet" href="../../css/variables.css">
        <link rel="stylesheet" href="../../css/general.css">
        <link rel="stylesheet" href="../../css/chrome.css">
        <link rel="stylesheet" href="../../css/print.css" media="print">

        <!-- Fonts -->
        <link rel="stylesheet" href="../../FontAwesome/css/font-awesome.css">
        <link rel="stylesheet" href="../../fonts/fonts.css">

        <!-- Highlight.js Stylesheets -->
        <link rel="stylesheet" href="../../highlight.css">
        <link rel="stylesheet" href="../../tomorrow-night.css">
        <link rel="stylesheet" href="../../ayu-highlight.css">

        <!-- Custom theme stylesheets -->

    </head>
    <body class="sidebar-visible no-js">
    <div id="body-container">
        <!-- Provide site root to javascript -->
        <script>
            var path_to_root = "../../";
            var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
        </script>

        <!-- Work around some values being stored in localStorage wrapped in quotes -->
        <script>
            try {
                var theme = localStorage.getItem('mdbook-theme');
                var sidebar = localStorage.getItem('mdbook-sidebar');

                if (theme.startsWith('"') && theme.endsWith('"')) {
                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
                }

                if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
                }
            } catch (e) { }
        </script>

        <!-- Set the theme before any content is loaded, prevents flash -->
        <script>
            var theme;
            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
            if (theme === null || theme === undefined) { theme = default_theme; }
            var html = document.querySelector('html');
            html.classList.remove('light')
            html.classList.add(theme);
            var body = document.querySelector('body');
            body.classList.remove('no-js')
            body.classList.add('js');
        </script>

        <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">

        <!-- Hide / unhide sidebar before it is displayed -->
        <script>
            var body = document.querySelector('body');
            var sidebar = null;
            var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
            if (document.body.clientWidth >= 1080) {
                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
                sidebar = sidebar || 'visible';
            } else {
                sidebar = 'hidden';
            }
            sidebar_toggle.checked = sidebar === 'visible';
            body.classList.remove('sidebar-visible');
            body.classList.add("sidebar-" + sidebar);
        </script>

        <nav id="sidebar" class="sidebar" aria-label="Table of contents">
            <div class="sidebar-scrollbox">
                <ol class="chapter"><li class="chapter-item expanded affix "><a href="../../PREFACE.html">前言</a></li><li class="chapter-item expanded affix "><li class="part-title">快速上手</li><li class="chapter-item expanded "><a href="../../zh/tutorials/index.html"><strong aria-hidden="true">1.</strong> 快速上手</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../zh/tutorials/typescript-in-5-minutes.html"><strong aria-hidden="true">1.1.</strong> 5 分钟了解 TypeScript</a></li><li class="chapter-item expanded "><a href="../../zh/tutorials/asp.net-core.html"><strong aria-hidden="true">1.2.</strong> ASP.NET Core</a></li><li class="chapter-item expanded "><a href="../../zh/tutorials/asp.net-4.html"><strong aria-hidden="true">1.3.</strong> ASP.NET 4</a></li><li class="chapter-item expanded "><a href="../../zh/tutorials/gulp.html"><strong aria-hidden="true">1.4.</strong> Gulp</a></li><li class="chapter-item expanded "><a href="../../zh/tutorials/knockout.html"><strong aria-hidden="true">1.5.</strong> Knockout.js</a></li><li class="chapter-item expanded "><a href="../../zh/tutorials/react-and-webpack.html"><strong aria-hidden="true">1.6.</strong> React 与 webpack</a></li><li class="chapter-item expanded "><a href="../../zh/tutorials/react.html"><strong aria-hidden="true">1.7.</strong> React</a></li><li class="chapter-item expanded "><a href="../../zh/tutorials/angular-2.html"><strong aria-hidden="true">1.8.</strong> Angular 2</a></li><li class="chapter-item expanded "><a href="../../zh/tutorials/migrating-from-javascript.html"><strong aria-hidden="true">1.9.</strong> 从 JavaScript 迁移到 TypeScript</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">手册</li><li class="chapter-item expanded "><a href="../../zh/handbook/index.html"><strong aria-hidden="true">2.</strong> 手册</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../zh/handbook/basic-types.html"><strong aria-hidden="true">2.1.</strong> 基础类型</a></li><li class="chapter-item expanded "><a href="../../zh/handbook/interfaces.html"><strong aria-hidden="true">2.2.</strong> 接口</a></li><li class="chapter-item expanded "><a href="../../zh/handbook/functions.html"><strong aria-hidden="true">2.3.</strong> 函数</a></li><li class="chapter-item expanded "><a href="../../zh/handbook/literal-types.html"><strong aria-hidden="true">2.4.</strong> 字面量类型</a></li><li class="chapter-item expanded "><a href="../../zh/handbook/unions-and-intersections.html"><strong aria-hidden="true">2.5.</strong> 联合类型和交叉类型</a></li><li class="chapter-item expanded "><a href="../../zh/handbook/classes.html"><strong aria-hidden="true">2.6.</strong> 类</a></li><li class="chapter-item expanded "><a href="../../zh/handbook/enums.html"><strong aria-hidden="true">2.7.</strong> 枚举</a></li><li class="chapter-item expanded "><a href="../../zh/handbook/generics.html"><strong aria-hidden="true">2.8.</strong> 泛型</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">手册（进阶）</li><li class="chapter-item expanded "><a href="../../zh/reference/index.html"><strong aria-hidden="true">3.</strong> 手册（进阶）</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../zh/reference/advanced-types.html"><strong aria-hidden="true">3.1.</strong> 高级类型</a></li><li class="chapter-item expanded "><a href="../../zh/reference/utility-types.html"><strong aria-hidden="true">3.2.</strong> 实用工具类型</a></li><li class="chapter-item expanded "><a href="../../zh/reference/decorators.html"><strong aria-hidden="true">3.3.</strong> Decorators</a></li><li class="chapter-item expanded "><a href="../../zh/reference/declaration-merging.html"><strong aria-hidden="true">3.4.</strong> 声明合并</a></li><li class="chapter-item expanded "><a href="../../zh/reference/iterators-and-generators.html"><strong aria-hidden="true">3.5.</strong> Iterators 和 Generators</a></li><li class="chapter-item expanded "><a href="../../zh/reference/jsx.html"><strong aria-hidden="true">3.6.</strong> JSX</a></li><li class="chapter-item expanded "><a href="../../zh/reference/mixins.html"><strong aria-hidden="true">3.7.</strong> 混入</a></li><li class="chapter-item expanded "><a href="../../zh/reference/modules.html"><strong aria-hidden="true">3.8.</strong> 模块</a></li><li class="chapter-item expanded "><a href="../../zh/reference/module-resolution.html"><strong aria-hidden="true">3.9.</strong> 模块解析</a></li><li class="chapter-item expanded "><a href="../../zh/reference/namespaces.html"><strong aria-hidden="true">3.10.</strong> 命名空间</a></li><li class="chapter-item expanded "><a href="../../zh/reference/namespaces-and-modules.html"><strong aria-hidden="true">3.11.</strong> 命名空间和模块</a></li><li class="chapter-item expanded "><a href="../../zh/reference/symbols.html"><strong aria-hidden="true">3.12.</strong> Symbols</a></li><li class="chapter-item expanded "><a href="../../zh/reference/triple-slash-directives.html"><strong aria-hidden="true">3.13.</strong> 三斜线指令</a></li><li class="chapter-item expanded "><a href="../../zh/reference/type-compatibility.html"><strong aria-hidden="true">3.14.</strong> 类型兼容性</a></li><li class="chapter-item expanded "><a href="../../zh/reference/type-inference.html"><strong aria-hidden="true">3.15.</strong> 类型推论</a></li><li class="chapter-item expanded "><a href="../../zh/reference/variable-declarations.html"><strong aria-hidden="true">3.16.</strong> 变量声明</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">手册（v2）</li><li class="chapter-item expanded "><a href="../../zh/handbook-v2/index.html"><strong aria-hidden="true">4.</strong> 手册（v2）</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../zh/handbook-v2/type-manipulation/template-literal-types.html"><strong aria-hidden="true">4.1.</strong> 模版字面量类型</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">TypeScript 声明文件（.d.ts）</li><li class="chapter-item expanded "><a href="../../zh/declaration-files/index.html"><strong aria-hidden="true">5.</strong> 如何书写声明文件</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../zh/declaration-files/introduction.html"><strong aria-hidden="true">5.1.</strong> 介绍</a></li><li class="chapter-item expanded "><a href="../../zh/declaration-files/by-example.html"><strong aria-hidden="true">5.2.</strong> 举例</a></li><li class="chapter-item expanded "><a href="../../zh/declaration-files/library-structures.html"><strong aria-hidden="true">5.3.</strong> 库结构</a></li><li class="chapter-item expanded "><a href="../../zh/declaration-files/templates.html"><strong aria-hidden="true">5.4.</strong> 模板</a></li><li class="chapter-item expanded "><a href="../../zh/declaration-files/do-s-and-don-ts.html"><strong aria-hidden="true">5.5.</strong> 最佳实践</a></li><li class="chapter-item expanded "><a href="../../zh/declaration-files/deep-dive.html"><strong aria-hidden="true">5.6.</strong> 深入</a></li><li class="chapter-item expanded "><a href="../../zh/declaration-files/publishing.html"><strong aria-hidden="true">5.7.</strong> 发布</a></li><li class="chapter-item expanded "><a href="../../zh/declaration-files/consumption.html"><strong aria-hidden="true">5.8.</strong> 使用</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">TypeScript for JavaScript</li><li class="chapter-item expanded "><a href="../../zh/javascript/type-checking-javascript-files.html"><strong aria-hidden="true">6.</strong> JavaScript 文件里的类型检查</a></li><li class="chapter-item expanded affix "><li class="part-title">工程配置</li><li class="chapter-item expanded "><a href="../../zh/project-config/index.html"><strong aria-hidden="true">7.</strong> 工程配置</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../zh/project-config/tsconfig.json.html"><strong aria-hidden="true">7.1.</strong> tsconfig.json</a></li><li class="chapter-item expanded "><a href="../../zh/project-config/project-references.html"><strong aria-hidden="true">7.2.</strong> 工程引用</a></li><li class="chapter-item expanded "><a href="../../zh/project-config/typings-for-npm-packages.html"><strong aria-hidden="true">7.3.</strong> NPM 包的类型</a></li><li class="chapter-item expanded "><a href="../../zh/project-config/compiler-options.html"><strong aria-hidden="true">7.4.</strong> 编译选项</a></li><li class="chapter-item expanded "><a href="../../zh/project-config/configuring-watch.html"><strong aria-hidden="true">7.5.</strong> 配置 Watch</a></li><li class="chapter-item expanded "><a href="../../zh/project-config/compiler-options-in-msbuild.html"><strong aria-hidden="true">7.6.</strong> 在 MSBuild 里使用编译选项</a></li><li class="chapter-item expanded "><a href="../../zh/project-config/integrating-with-build-tools.html"><strong aria-hidden="true">7.7.</strong> 与其它构建工具整合</a></li><li class="chapter-item expanded "><a href="../../zh/project-config/nightly-builds.html"><strong aria-hidden="true">7.8.</strong> 使用 TypeScript 的每日构建版本</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">版本发布说明（Release Notes）</li><li class="chapter-item expanded "><a href="../../zh/release-notes/index.html"><strong aria-hidden="true">8.</strong> 新增功能</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-5.4.html"><strong aria-hidden="true">8.1.</strong> TypeScript 5.4</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-5.3.html"><strong aria-hidden="true">8.2.</strong> TypeScript 5.3</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-5.2.html"><strong aria-hidden="true">8.3.</strong> TypeScript 5.2</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-5.1.html"><strong aria-hidden="true">8.4.</strong> TypeScript 5.1</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-5.0.html"><strong aria-hidden="true">8.5.</strong> TypeScript 5.0</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-4.9.html"><strong aria-hidden="true">8.6.</strong> TypeScript 4.9</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-4.8.html"><strong aria-hidden="true">8.7.</strong> TypeScript 4.8</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-4.7.html"><strong aria-hidden="true">8.8.</strong> TypeScript 4.7</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-4.6.html"><strong aria-hidden="true">8.9.</strong> TypeScript 4.6</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-4.5.html"><strong aria-hidden="true">8.10.</strong> TypeScript 4.5</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-4.4.html"><strong aria-hidden="true">8.11.</strong> TypeScript 4.4</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-4.3.html"><strong aria-hidden="true">8.12.</strong> TypeScript 4.3</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-4.2.html"><strong aria-hidden="true">8.13.</strong> TypeScript 4.2</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-4.1.html"><strong aria-hidden="true">8.14.</strong> TypeScript 4.1</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-4.0.html"><strong aria-hidden="true">8.15.</strong> TypeScript 4.0</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-3.9.html"><strong aria-hidden="true">8.16.</strong> TypeScript 3.9</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-3.8.html"><strong aria-hidden="true">8.17.</strong> TypeScript 3.8</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-3.7.html"><strong aria-hidden="true">8.18.</strong> TypeScript 3.7</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-3.6.html"><strong aria-hidden="true">8.19.</strong> TypeScript 3.6</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-3.5.html"><strong aria-hidden="true">8.20.</strong> TypeScript 3.5</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-3.4.html"><strong aria-hidden="true">8.21.</strong> TypeScript 3.4</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-3.3.html"><strong aria-hidden="true">8.22.</strong> TypeScript 3.3</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-3.2.html"><strong aria-hidden="true">8.23.</strong> TypeScript 3.2</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-3.1.html"><strong aria-hidden="true">8.24.</strong> TypeScript 3.1</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-3.0.html"><strong aria-hidden="true">8.25.</strong> TypeScript 3.0</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-2.9.html"><strong aria-hidden="true">8.26.</strong> TypeScript 2.9</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-2.8.html"><strong aria-hidden="true">8.27.</strong> TypeScript 2.8</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-2.7.html"><strong aria-hidden="true">8.28.</strong> TypeScript 2.7</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-2.6.html"><strong aria-hidden="true">8.29.</strong> TypeScript 2.6</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-2.5.html"><strong aria-hidden="true">8.30.</strong> TypeScript 2.5</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-2.4.html"><strong aria-hidden="true">8.31.</strong> TypeScript 2.4</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-2.3.html"><strong aria-hidden="true">8.32.</strong> TypeScript 2.3</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-2.2.html"><strong aria-hidden="true">8.33.</strong> TypeScript 2.2</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-2.1.html" class="active"><strong aria-hidden="true">8.34.</strong> TypeScript 2.1</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-2.0.html"><strong aria-hidden="true">8.35.</strong> TypeScript 2.0</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-1.8.html"><strong aria-hidden="true">8.36.</strong> TypeScript 1.8</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-1.7.html"><strong aria-hidden="true">8.37.</strong> TypeScript 1.7</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-1.6.html"><strong aria-hidden="true">8.38.</strong> TypeScript 1.6</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-1.5.html"><strong aria-hidden="true">8.39.</strong> TypeScript 1.5</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-1.4.html"><strong aria-hidden="true">8.40.</strong> TypeScript 1.4</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-1.3.html"><strong aria-hidden="true">8.41.</strong> TypeScript 1.3</a></li><li class="chapter-item expanded "><a href="../../zh/release-notes/typescript-1.1.html"><strong aria-hidden="true">8.42.</strong> TypeScript 1.1</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">破坏性改动（Breaking Changes）</li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/index.html"><strong aria-hidden="true">9.</strong> Breaking Changes</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-3.6.html"><strong aria-hidden="true">9.1.</strong> TypeScript 3.6</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-3.5.html"><strong aria-hidden="true">9.2.</strong> TypeScript 3.5</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-3.4.html"><strong aria-hidden="true">9.3.</strong> TypeScript 3.4</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-3.2.html"><strong aria-hidden="true">9.4.</strong> TypeScript 3.2</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-3.1.html"><strong aria-hidden="true">9.5.</strong> TypeScript 3.1</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-3.0.html"><strong aria-hidden="true">9.6.</strong> TypeScript 3.0</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-2.9.html"><strong aria-hidden="true">9.7.</strong> TypeScript 2.9</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-2.8.html"><strong aria-hidden="true">9.8.</strong> TypeScript 2.8</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-2.7.html"><strong aria-hidden="true">9.9.</strong> TypeScript 2.7</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-2.6.html"><strong aria-hidden="true">9.10.</strong> TypeScript 2.6</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-2.4.html"><strong aria-hidden="true">9.11.</strong> TypeScript 2.4</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-2.3.html"><strong aria-hidden="true">9.12.</strong> TypeScript 2.3</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-2.2.html"><strong aria-hidden="true">9.13.</strong> TypeScript 2.2</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-2.1.html"><strong aria-hidden="true">9.14.</strong> TypeScript 2.1</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-2.0.html"><strong aria-hidden="true">9.15.</strong> TypeScript 2.0</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-1.8.html"><strong aria-hidden="true">9.16.</strong> TypeScript 1.8</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-1.7.html"><strong aria-hidden="true">9.17.</strong> TypeScript 1.7</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-1.6.html"><strong aria-hidden="true">9.18.</strong> TypeScript 1.6</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-1.5.html"><strong aria-hidden="true">9.19.</strong> TypeScript 1.5</a></li><li class="chapter-item expanded "><a href="../../zh/breaking-changes/typescript-1.4.html"><strong aria-hidden="true">9.20.</strong> TypeScript 1.4</a></li></ol></li></ol>
            </div>
            <div id="sidebar-resize-handle" class="sidebar-resize-handle">
                <div class="sidebar-resize-indicator"></div>
            </div>
        </nav>

        <!-- Track and set sidebar scroll position -->
        <script>
            var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
            sidebarScrollbox.addEventListener('click', function(e) {
                if (e.target.tagName === 'A') {
                    sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
                }
            }, { passive: true });
            var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
            sessionStorage.removeItem('sidebar-scroll');
            if (sidebarScrollTop) {
                // preserve sidebar scroll position when navigating via links within sidebar
                sidebarScrollbox.scrollTop = sidebarScrollTop;
            } else {
                // scroll sidebar to current active section when navigating via "next/previous chapter" buttons
                var activeSection = document.querySelector('#sidebar .active');
                if (activeSection) {
                    activeSection.scrollIntoView({ block: 'center' });
                }
            }
        </script>

        <div id="page-wrapper" class="page-wrapper">

            <div class="page">
                                <div id="menu-bar-hover-placeholder"></div>
                <div id="menu-bar" class="menu-bar sticky">
                    <div class="left-buttons">
                        <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
                            <i class="fa fa-bars"></i>
                        </label>
                        <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
                            <i class="fa fa-paint-brush"></i>
                        </button>
                        <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
                            <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
                        </ul>
                        <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>

                    <h1 class="menu-title">TypeScript 使用指南手册</h1>

                    <div class="right-buttons">
                        <a href="../../print.html" title="Print this book" aria-label="Print this book">
                            <i id="print-button" class="fa fa-print"></i>
                        </a>

                    </div>
                </div>

                <div id="search-wrapper" class="hidden">
                    <form id="searchbar-outer" class="searchbar-outer">
                        <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
                    </form>
                    <div id="searchresults-outer" class="searchresults-outer hidden">
                        <div id="searchresults-header" class="searchresults-header"></div>
                        <ul id="searchresults">
                        </ul>
                    </div>
                </div>

                <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
                <script>
                    document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
                    document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
                    Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
                        link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
                    });
                </script>

                <div id="content" class="content">
                    <main>
                        <h1 id="typescript-21"><a class="header" href="#typescript-21">TypeScript 2.1</a></h1>
<h2 id="keyof和查找类型"><a class="header" href="#keyof和查找类型"><code>keyof</code>和查找类型</a></h2>
<p>在JavaScript中属性名称作为参数的API是相当普遍的，但是到目前为止还没有表达在那些API中出现的类型关系。</p>
<p>输入索引类型查询或<code>keyof</code>，索引类型查询<code>keyof T</code>产生的类型是<code>T</code>的属性名称。<code>keyof T</code>的类型被认为是<code>string</code>的子类型。</p>
<h4 id="示例"><a class="header" href="#示例">示例</a></h4>
<pre><code class="language-typescript">interface Person {
    name: string;
    age: number;
    location: string;
}

type K1 = keyof Person; // "name" | "age" | "location"
type K2 = keyof Person[];  // "length" | "push" | "pop" | "concat" | ...
type K3 = keyof { [x: string]: Person };  // string
</code></pre>
<p>与之相对应的是_索引访问类型_，也称为_查找类型_。在语法上，它们看起来像元素访问，但是写成类型：</p>
<h4 id="示例-1"><a class="header" href="#示例-1">示例</a></h4>
<pre><code class="language-typescript">type P1 = Person["name"];  // string
type P2 = Person["name" | "age"];  // string | number
type P3 = string["charAt"];  // (pos: number) =&gt; string
type P4 = string[]["push"];  // (...items: string[]) =&gt; number
type P5 = string[][0];  // string
</code></pre>
<p>你可以将这种模式和类型系统的其它部分一起使用，以获取类型安全的查找。</p>
<pre><code class="language-typescript">function getProperty&lt;T, K extends keyof T&gt;(obj: T, key: K) {
    return obj[key];  // 推断类型是T[K]
}

function setProperty&lt;T, K extends keyof T&gt;(obj: T, key: K, value: T[K]) {
    obj[key] = value;
}

let x = { foo: 10, bar: "hello!" };

let foo = getProperty(x, "foo"); // number
let bar = getProperty(x, "bar"); // string

let oops = getProperty(x, "wargarbl"); // 错误！"wargarbl"不存在"foo" | "bar"中

setProperty(x, "foo", "string"); // 错误！, 类型是number而非string
</code></pre>
<h2 id="映射类型"><a class="header" href="#映射类型">映射类型</a></h2>
<p>一个常见的任务是使用现有类型并使其每个属性完全可选。假设我们有一个<code>Person</code>：</p>
<pre><code class="language-typescript">interface Person {
    name: string;
    age: number;
    location: string;
}
</code></pre>
<p><code>Person</code>的可选属性类型将是这样：</p>
<pre><code class="language-typescript">interface PartialPerson {
    name?: string;
    age?: number;
    location?: string;
}
</code></pre>
<p>使用映射类型，<code>PartialPerson</code>可以写成是<code>Person</code>类型的广义变换：</p>
<pre><code class="language-typescript">type Partial&lt;T&gt; = {
    [P in keyof T]?: T[P];
};

type PartialPerson = Partial&lt;Person&gt;;
</code></pre>
<p>映射类型是通过使用字面量类型的集合而生成的，并为新对象类型计算一组属性。它们就像<a href="https://docs.python.org/2/tutorial/datastructures.html#nested-list-comprehensions">Python中的列表推导式</a>，但不是在列表中产生新的元素，而是在类型中产生新的属性。</p>
<p>除<code>Partial</code>外，映射类型可以表示许多有用的类型转换：</p>
<pre><code class="language-typescript">// 保持类型相同，但每个属性是只读的。
type Readonly&lt;T&gt; = {
    readonly [P in keyof T]: T[P];
};

// 相同的属性名称，但使值是一个Promise，而不是一个具体的值
type Deferred&lt;T&gt; = {
    [P in keyof T]: Promise&lt;T[P]&gt;;
};

// 为T的属性添加代理
type Proxify&lt;T&gt; = {
    [P in keyof T]: { get(): T[P]; set(v: T[P]): void }
};
</code></pre>
<h2 id="partialreadonlyrecord和pick"><a class="header" href="#partialreadonlyrecord和pick"><code>Partial</code>,<code>Readonly</code>,<code>Record</code>和<code>Pick</code></a></h2>
<p><code>Partial</code>和<code>Readonly</code>，如前所述，是非常有用的结构。你可以使用它们来描述像一些常见的JS程序：</p>
<pre><code class="language-typescript">function assign&lt;T&gt;(obj: T, props: Partial&lt;T&gt;): void;
function freeze&lt;T&gt;(obj: T): Readonly&lt;T&gt;;
</code></pre>
<p>因此，它们现在默认包含在标准库中。</p>
<p>我们还包括两个其他实用程序类型：<code>Record</code>和<code>Pick</code>。</p>
<pre><code class="language-typescript">// 从T中选取一组属性K
declare function pick&lt;T, K extends keyof T&gt;(obj: T, ...keys: K[]): Pick&lt;T, K&gt;;

const nameAndAgeOnly = pick(person, "name", "age");  // { name: string, age: number }
</code></pre>
<pre><code class="language-typescript">// 对于类型T的每个属性K，将其转换为U
function mapObject&lt;K extends string | number, T, U&gt;(obj: Record&lt;K, T&gt;, f: (x: T) =&gt; U): Record&lt;K, U&gt;

const names = { foo: "hello", bar: "world", baz: "bye" };
const lengths = mapObject(names, s =&gt; s.length);  // { foo: number, bar: number, baz: number }
</code></pre>
<h2 id="对象扩展运算符和rest运算符"><a class="header" href="#对象扩展运算符和rest运算符">对象扩展运算符和rest运算符</a></h2>
<p>TypeScript 2.1带来了<a href="https://github.com/sebmarkbage/ecmascript-rest-spread">ESnext扩展运算符和rest运算符</a>的支持。</p>
<p>类似于数组扩展，展开对象可以方便得到浅拷贝：</p>
<pre><code class="language-typescript">let copy = { ...original };
</code></pre>
<p>同样，您可以合并几个不同的对象。在以下示例中，合并将具有来自<code>foo</code>，<code>bar</code>和<code>baz</code>的属性。</p>
<pre><code class="language-typescript">let merged = { ...foo, ...bar, ...baz };
</code></pre>
<p>还可以重写现有属性并添加新属性.：</p>
<pre><code class="language-typescript">let obj = { x: 1, y: "string" };
var newObj = {...obj, z: 3, y: 4}; // { x: number, y: number, z: number }
</code></pre>
<p>指定展开操作的顺序确定哪些属性在最终的结果对象中。相同的属性，后面的属性会“覆盖”前面的属性。</p>
<p>与对象扩展运算符相对的是对象rest运算符，因为它可以提取解构元素中剩余的元素：</p>
<pre><code class="language-typescript">let obj = { x: 1, y: 1, z: 1 };
let { z, ...obj1 } = obj;
obj1; // {x: number, y: number};
</code></pre>
<h2 id="低版本异步函数"><a class="header" href="#低版本异步函数">低版本异步函数</a></h2>
<p>该特性在TypeScript 2.1之前就已经支持了，但是只能编译为ES6或者ES2015。TypeScript 2.1使其该特性可以在ES3和ES5运行时上使用，这意味着无论您使用什么环境，都可以使用它。</p>
<blockquote>
<p>注：首先，我们需要确保我们的运行时提供全局的ECMAScript兼容性<code>Promise</code>。这可能需要获取<code>Promise</code>的<a href="https://github.com/stefanpenner/es6-promise">polyfill</a>，或者依赖运行时的版本。我们还需要通过设置<code>lib</code>编译参数，比如<code>"dom","es2015"</code>或<code>"dom","es2015.promise","es5"</code>来确保TypeScript知道<code>Promise</code>可用。</p>
</blockquote>
<h4 id="示例-2"><a class="header" href="#示例-2">示例</a></h4>
<p><strong>tsconfig.json</strong></p>
<pre><code class="language-javascript">{
    "compilerOptions": {
        "lib": ["dom", "es2015.promise", "es5"]
    }
}
</code></pre>
<p><strong>dramaticWelcome.ts</strong></p>
<pre><code class="language-typescript">function delay(milliseconds: number) {
    return new Promise&lt;void&gt;(resolve =&gt; {
        setTimeout(resolve, milliseconds);
    });
}

async function dramaticWelcome() {
    console.log("Hello");

    for (let i = 0; i &lt; 3; i++) {
        await delay(500);
        console.log(".");
    }

    console.log("World!");
}

dramaticWelcome();
</code></pre>
<p>编译和运行输出应该会在ES3/ES5引擎上产生正确的行为。</p>
<h2 id="支持外部辅助库tslib"><a class="header" href="#支持外部辅助库tslib">支持外部辅助库（<code>tslib</code>）</a></h2>
<p>TypeScript注入了一些辅助函数，如继承<code>_extends</code>、JSX中的展开运算符<code>__assign</code>和异步函数<code>__awaiter</code>。</p>
<p>以前有两个选择：</p>
<ol>
<li>在_每一个_需要辅助库的文件都注入辅助库或者</li>
<li>使用<code>--noEmitHelpers</code>编译参数完全不使用辅助库。</li>
</ol>
<p>这两项还有待改进。将帮助文件捆绑在每个文件中对于试图保持其包尺寸小的客户而言是一个痛点。不使用辅助库，那么客户就必须自己维护辅助库。</p>
<p>TypeScript 2.1 允许这些辅助库作为单独的模块一次性添加到项目中，并且编译器根据需求导入它们。</p>
<p>首先，安装<code>tslib</code>：</p>
<pre><code class="language-text">npm install tslib
</code></pre>
<p>然后，使用<code>--importHelpers</code>编译你的文件：</p>
<pre><code class="language-text">tsc --module commonjs --importHelpers a.ts
</code></pre>
<p>因此下面的输入，生成的<code>.js</code>文件将包含<code>tslib</code>的导入和使用<code>__assign</code>辅助函数替代内联操作。</p>
<pre><code class="language-typescript">export const o = { a: 1, name: "o" };
export const copy = { ...o };
</code></pre>
<pre><code class="language-javascript">"use strict";
var tslib_1 = require("tslib");
exports.o = { a: 1, name: "o" };
exports.copy = tslib_1.__assign({}, exports.o);
</code></pre>
<h2 id="无类型导入"><a class="header" href="#无类型导入">无类型导入</a></h2>
<p>TypeScript历来对于如何导入模块过于严格。这是为了避免输入错误，并防止用户错误地使用模块。</p>
<p>但是，很多时候你可能只想导入的现有模块，但是这些模块可能没有<code>.d.ts</code>文件。以前这是错误的。从TypeScript 2.1开始，这更容易了。</p>
<p>使用TypeScript 2.1，您可以导入JavaScript模块，而不需要类型声明。如果类型声明（如<code>declare module "foo" { ... }</code>或<code>node_modules/@types/foo</code>）存在，则仍然优先。</p>
<p>对于没有声明文件的模块的导入，在使用了<code>--noImplicitAny</code>编译参数后仍将被标记为错误。</p>
<pre><code class="language-typescript">// Succeeds if `node_modules/asdf/index.js` exists
import { x } from "asdf";
</code></pre>
<h2 id="支持--target-es2016--target-es2017和--target-esnext"><a class="header" href="#支持--target-es2016--target-es2017和--target-esnext">支持<code>--target ES2016</code>,<code>--target ES2017</code>和<code>--target ESNext</code></a></h2>
<p>TypeScript 2.1支持三个新的编译版本值<code>--target ES2016</code>,<code>--target ES2017</code>和<code>--target ESNext</code>。</p>
<p>使用target<code>--target ES2016</code>将指示编译器不要编译ES2016特有的特性，比如<code>**</code>操作符。</p>
<p>同样，<code>--target ES2017</code>将指示编译器不要编译ES2017特有的特性像<code>async/await</code>。</p>
<p><code>--target ESNext</code>则对应最新的<a href="https://github.com/tc39/proposals">ES提议特性</a>支持.</p>
<h2 id="改进any类型推断"><a class="header" href="#改进any类型推断">改进<code>any</code>类型推断</a></h2>
<p>以前，如果TypeScript无法确定变量的类型，它将选择<code>any</code>类型。</p>
<pre><code class="language-typescript">let x;      // 隐式 'any'
let y = []; // 隐式 'any[]'

let z: any; // 显式 'any'.
</code></pre>
<p>使用TypeScript 2.1，TypeScript不是仅仅选择<code>any</code>类型，而是基于你后面的赋值来推断类型。</p>
<p>仅当设置了<code>--noImplicitAny</code>编译参数时，才会启用此选项。</p>
<h4 id="示例-3"><a class="header" href="#示例-3">示例</a></h4>
<pre><code class="language-typescript">let x;

// 你仍然可以给'x'赋值任何你需要的任何值。
x = () =&gt; 42;

// 在刚赋值后，TypeScript 2.1 知道'x'的类型是'() =&gt; number'。
let y = x();

// 感谢，现在它会告诉你，你不能添加一个数字到一个函数！
console.log(x + y);
//          ~~~~~
// 错误！运算符 '+' 不能应用于类型`() =&gt; number`和'number'。

// TypeScript仍然允许你给'x'赋值你需要的任何值。
x = "Hello world!";

// 并且现在它也知道'x'是'string'类型的！
x.toLowerCase();
</code></pre>
<p>现在对空数组也进行同样的跟踪。</p>
<p>没有类型注解并且初始值为<code>[]</code>的变量被认为是一个隐式的<code>any[]</code>变量。变量会根据下面这些操作<code>x.push(value)</code>、<code>x.unshift(value)</code>或<code>x[n] = value</code>向其中添加的元素来_不断改变_自身的类型。</p>
<pre><code class="language-typescript">function f1() {
    let x = [];
    x.push(5);
    x[1] = "hello";
    x.unshift(true);
    return x;  // (string | number | boolean)[]
}

function f2() {
    let x = null;
    if (cond()) {
        x = [];
        while (cond()) {
            x.push("hello");
        }
    }
    return x;  // string[] | null
}
</code></pre>
<h3 id="隐式any错误"><a class="header" href="#隐式any错误">隐式any错误</a></h3>
<p>这样做的一个很大的好处是，当使用<code>--noImplicitAny</code>运行时，你将看到_较少_的隐式<code>any</code>错误。隐式<code>any</code>错误只会在编译器无法知道一个没有类型注解的变量的类型时才会报告。</p>
<h4 id="示例-4"><a class="header" href="#示例-4">示例</a></h4>
<pre><code class="language-typescript">function f3() {
    let x = [];  // 错误：当变量'x'类型无法确定时，它隐式具有'any[]'类型。
    x.push(5);
    function g() {
        x;    // 错误：变量'x'隐式具有'any【】'类型。
    }
}
</code></pre>
<h2 id="更好的字面量类型推断"><a class="header" href="#更好的字面量类型推断">更好的字面量类型推断</a></h2>
<p>字符串、数字和布尔字面量类型（如：<code>"abc"</code>，<code>1</code>和<code>true</code>）之前仅在存在显式类型注释时才被推断。从TypeScript 2.1开始，字面量类型_总是_推断为默认值。</p>
<p>不带类型注解的<code>const</code>变量或<code>readonly</code>属性的类型推断为字面量初始化的类型。已经初始化且不带类型注解的<code>let</code>变量、<code>var</code>变量、形参或非<code>readonly</code>属性的类型推断为初始值的扩展字面量类型。字符串字面量扩展类型是<code>string</code>，数字字面量扩展类型是<code>number</code>,<code>true</code>或<code>false</code>的字面量类型是<code>boolean</code>，还有枚举字面量扩展类型是枚举。</p>
<h4 id="示例-5"><a class="header" href="#示例-5">示例</a></h4>
<pre><code class="language-typescript">const c1 = 1;  // Type 1
const c2 = c1;  // Type 1
const c3 = "abc";  // Type "abc"
const c4 = true;  // Type true
const c5 = cond ? 1 : "abc";  // Type 1 | "abc"

let v1 = 1;  // Type number
let v2 = c2;  // Type number
let v3 = c3;  // Type string
let v4 = c4;  // Type boolean
let v5 = c5;  // Type number | string
</code></pre>
<p>字面量类型扩展可以通过显式类型注解来控制。具体来说，当为不带类型注解的<code>const</code>局部变量推断字面量类型的表达式时，<code>var</code>变量获得扩展字面量类型推断。但是当<code>const</code>局部变量有显式字面量类型注解时，<code>var</code>变量获得非扩展字面量类型。</p>
<h4 id="示例-6"><a class="header" href="#示例-6">示例</a></h4>
<pre><code class="language-typescript">const c1 = "hello";  // Widening type "hello"
let v1 = c1;  // Type string

const c2: "hello" = "hello";  // Type "hello"
let v2 = c2;  // Type "hello"
</code></pre>
<h2 id="将基类构造函数的返回值作为this"><a class="header" href="#将基类构造函数的返回值作为this">将基类构造函数的返回值作为'this'</a></h2>
<p>在ES2015中，构造函数的返回值（它是一个对象）隐式地将<code>this</code>的值替换为<code>super()</code>的任何调用者。因此，有必要捕获任何潜在的<code>super()</code>的返回值并替换为<code>this</code>。此更改允许<a href="https://w3c.github.io/webcomponents/spec/custom/#htmlelement-constructor">使用自定义元素</a>，利用此元素可以使用用户编写的构造函数初始化浏览器分配的元素。</p>
<h4 id="示例-7"><a class="header" href="#示例-7">示例</a></h4>
<pre><code class="language-typescript">class Base {
    x: number;
    constructor() {
        // 返回一个除“this”之外的新对象
        return {
            x: 1,
        };
    }
}

class Derived extends Base {
    constructor() {
        super();
        this.x = 2;
    }
}
</code></pre>
<p>生成：</p>
<pre><code class="language-javascript">var Derived = (function (_super) {
    __extends(Derived, _super);
    function Derived() {
        var _this = _super.call(this) || this;
        _this.x = 2;
        return _this;
    }
    return Derived;
}(Base));
</code></pre>
<blockquote>
<p>这在继承内置类如<code>Error</code>，<code>Array</code>，<code>Map</code>等的行为上有了破坏性的改变。请阅读<a href="https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work">extending built-ins breaking change documentation</a>。</p>
</blockquote>
<h2 id="配置继承"><a class="header" href="#配置继承">配置继承</a></h2>
<p>通常一个项目有多个输出版本，比如<code>ES5</code>和<code>ES2015</code>，调试和生产或<code>Commonjs</code>和<code>System</code>。只有几个配置选项在这两个版本之间改变，并且维护多个<code>tsconfig.json</code>文件是麻烦的。</p>
<p>TypeScript 2.1支持使用<code>extends</code>来继承配置，其中：</p>
<ul>
<li><code>extends</code>在<code>tsconfig.json</code>是新的顶级属性（与<code>compilerOptions</code>、<code>files</code>、<code>include</code>和<code>exclude</code>一起）。</li>
<li><code>extends</code>的值是包含继承自其它<code>tsconfig.json</code>路径的字符串。</li>
<li>首先加载基本文件中的配置，然后由继承配置文件重写。</li>
<li>如果遇到循环，我们报告错误。</li>
<li>继承配置文件中的<code>files</code>、<code>include</code>和<code>exclude</code>会重写基本配置文件中相应的值。</li>
<li>在配置文件中找到的所有相对路径将相对于它们来源的配置文件来解析。</li>
</ul>
<h4 id="示例-8"><a class="header" href="#示例-8">示例</a></h4>
<p><code>configs/base.json</code>:</p>
<pre><code class="language-javascript">{
  "compilerOptions": {
    "allowJs": true,
    "noImplicitAny": true,
    "strictNullChecks": true
  }
}
</code></pre>
<p><code>configs/tests.json</code>:</p>
<pre><code class="language-javascript">{
  "compilerOptions": {
    "preserveConstEnums": true,
    "stripComments": false,
    "sourceMaps": true
  },
  "exclude": [
    "../tests/baselines",
    "../tests/scenarios"
  ],
  "include": [
    "../tests/**/*.ts"
  ]
}
</code></pre>
<p><code>tsconfig.json</code>:</p>
<pre><code class="language-javascript">{
  "extends": "./configs/base",
  "files": [
    "main.ts",
    "supplemental.ts"
  ]
}
</code></pre>
<p><code>tsconfig.nostrictnull.json</code>:</p>
<pre><code class="language-javascript">{
  "extends": "./tsconfig",
  "compilerOptions": {
    "strictNullChecks": false
  }
}
</code></pre>
<h2 id="新编译参数--alwaysstrict"><a class="header" href="#新编译参数--alwaysstrict">新编译参数<code>--alwaysStrict</code></a></h2>
<p>使用<code>--alwaysStrict</code>调用编译器原因：1.在严格模式下解析的所有代码。2.在每一个生成文件上输出<code>"use strict";</code>指令;</p>
<p>模块会自动使用严格模式解析。对于非模块代码，建议使用该编译参数。</p>

                    </main>

                    <nav class="nav-wrapper" aria-label="Page navigation">
                        <!-- Mobile navigation buttons -->
                            <a rel="prev" href="../../zh/release-notes/typescript-2.2.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                                <i class="fa fa-angle-left"></i>
                            </a>

                            <a rel="next prefetch" href="../../zh/release-notes/typescript-2.0.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                                <i class="fa fa-angle-right"></i>
                            </a>

                        <div style="clear: both"></div>
                    </nav>
                </div>
            </div>

            <nav class="nav-wide-wrapper" aria-label="Page navigation">
                    <a rel="prev" href="../../zh/release-notes/typescript-2.2.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                        <i class="fa fa-angle-left"></i>
                    </a>

                    <a rel="next prefetch" href="../../zh/release-notes/typescript-2.0.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                        <i class="fa fa-angle-right"></i>
                    </a>
            </nav>

        </div>




        <script>
            window.playground_copyable = true;
        </script>


        <script src="../../elasticlunr.min.js"></script>
        <script src="../../mark.min.js"></script>
        <script src="../../searcher.js"></script>

        <script src="../../clipboard.min.js"></script>
        <script src="../../highlight.js"></script>
        <script src="../../book.js"></script>

        <!-- Custom JS scripts -->


    </div>
    </body>
</html>
